package cc.mrbird.febs.member.entity;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotBlank;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wuwenze.poi.annotation.Excel;
import com.wuwenze.poi.annotation.ExcelField;

import cc.mrbird.febs.common.annotation.IsMobile;
import cc.mrbird.febs.common.converter.TimeConverter;
import lombok.Data;

/**
 * 会员表 Entity
 *
 * @author Lord
 * @date 2020-06-06 15:48:19
 */
@Data
@TableName("t_member")
@Excel("会员信息表")
public class Member implements Serializable {

    private static final long serialVersionUID = -3866831705296366351L;

    /**
     * 会员 ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 手机号码
     */
    @TableField("phone")
    @IsMobile(message = "{mobile}")
    @ExcelField(value = "手机号码")
    private String phone;

    /**
     * 昵称
     */
    @TableField("nickname")
    @ExcelField(value = "昵称")
    private String nickname;

    /**
     * 真实姓名
     */
    @TableField("realname")
    @ExcelField(value = "真实姓名")
    private String realname;

    /**
     * 帐号启用状态:0->禁用；1->启用
     */
    @TableField("status")
    @NotBlank(message = "{required}")
    @ExcelField(value = "状态", writeConverterExp = "0=禁用,1=启用")
    private Integer status;

    /**
     * 注册时间
     */
    @TableField("create_time")
    @ExcelField(value = "注册时间", writeConverter = TimeConverter.class)
    private Date createTime;

    /**
     * 头像
     */
    @TableField("icon")
    private String icon;

    /**
     * 性别：0->未知；1->男；2->女
     */
    @TableField("gender")
    @ExcelField(value = "性别", writeConverterExp = "0=未知,1=男,2=女")
    private Integer gender;

    /**
     * 生日
     */
    @TableField("birthday")
    private Date birthday;

    /**
     * 所做城市
     */
    @TableField("city")
    private String city;

    /**
     * 职业
     */
    @TableField("job")
    private String job;

    /**
     * 个性签名
     */
    @TableField("personalized_signature")
    private String personalizedSignature;

    @TableField(exist = false)
    private String token;
}
